public class Leet1342 {
    public int numberOfSteps(int num) {
        int re = 0;
        while (num!=0){
            re++;
            if (num%2==0)
                num = num/2;
            else num = num-1;
        }
        return re;
    }
}
